﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Banesco.Entidades;
using System.Data;

namespace Banesco.Logica
{
    public class BSEIBS
    {
        private CustomerService.PersonalCustMessage _wsPersonalCustMessage;
        private AccountService.AccountsMessage _wsAccountsMessage;

        public AccountsMessage newAccount(AccountsMessage newAccountInput)
        {
            AccountsMessage retMensaje = new AccountsMessage();

            try
            {
                _wsAccountsMessage = new AccountService.AccountsMessage();
                HelperAccountService.ConvertirAccountsMessage(newAccountInput, ref _wsAccountsMessage);

                HelperAccountService.ConvertirAccountsMessage((new AccountService.AccountServicesClient()).newAccount(_wsAccountsMessage), ref retMensaje);
            }
            catch (Exception ex)
            { }

            return retMensaje;
        }

        public PersonalCustMessage personalCustomerInquiry(string user, string customerId)
        {
            PersonalCustMessage retMensaje = new PersonalCustMessage();

            try
            {
                HelperCustomerService.ConvertirPersonalCustMessage((new CustomerService.CustomerServicesClient()).personalCustomerInquiry(user, customerId), ref retMensaje);
            }
            catch (Exception ex)
            { }

            return retMensaje;
        }

        public PersonalCustMessage personalCustomerMaintenance(PersonalCustMessage personalCustomerMaintenanceInput)
        {
            PersonalCustMessage retMensaje = new PersonalCustMessage();

            try
            {
                _wsPersonalCustMessage = new CustomerService.PersonalCustMessage();
                HelperCustomerService.ConvertirPersonalCustMessage(personalCustomerMaintenanceInput, ref _wsPersonalCustMessage);

                HelperCustomerService.ConvertirPersonalCustMessage((new CustomerService.CustomerServicesClient()).personalCustomerMaintenance(_wsPersonalCustMessage), ref retMensaje);
            }
            catch (Exception ex)
            { }

            return retMensaje;
        }

        public PersonalCustMessage newPersonalCustomer(PersonalCustMessage newPersonalCustomerInput)
        {
            PersonalCustMessage retMensaje = new PersonalCustMessage();

            try
            {
                _wsPersonalCustMessage = new CustomerService.PersonalCustMessage();
                HelperCustomerService.ConvertirPersonalCustMessage(newPersonalCustomerInput, ref _wsPersonalCustMessage);

                HelperCustomerService.ConvertirPersonalCustMessage((new CustomerService.CustomerServicesClient()).newPersonalCustomer(_wsPersonalCustMessage), ref retMensaje);
            }
            catch (Exception ex)
            { }

            return retMensaje;
        }
    }
}
